package com.concurrent;


import java.util.concurrent.Callable;

public class Student implements Runnable,Callable {
    private String name;

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public Student(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        System.out.println("当前线程为："+Thread.currentThread());
        System.out.println("name为 "+name+" 的同学被消费");
    }

    @Override
    public Object call() throws Exception {
        System.out.println("当前线程为："+Thread.currentThread());
        System.out.println("name为 "+name+" 的同学被消费");
        return name;
    }
}
